package se.webbzon.boltzmann.battle.strategy.playerstrategy;

import se.webbzon.boltzmann.battle.battleaction.BattleActionFactory;

public abstract class AbstractPSActionIcon extends AbstractPSIcon {

	// The battle action factory associated with this icon
	private final BattleActionFactory factory;
	
	/*============================================================
	Constructors
	============================================================*/
	
	/** Creates a new abstract player strategy icon page action associated to
	 * a battle action factory. **/
	public AbstractPSActionIcon(BattleActionFactory factory) {
		super(factory.getIcon().getImage(), factory.getIcon().getName());
		this.factory = factory;
	}
	
	/*============================================================
	Public Methods
	============================================================*/

	@Override public void onSelect(PlayerStrategyHud psh, AbstractPSPage page) {
		PSTargetPage targetPage = 
				new PSTargetPage(page, factory, psh);
		psh.setPage(targetPage);
	}

}
